package com.zdy.viewpager;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems;

public class MainActivity extends FragmentActivity {
	private static final String TAG = "MainActivity";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
				getSupportFragmentManager(), FragmentPagerItems.with(this)
						.add("AAAA", DemoFragment.class)
						.add("BBBB", DemoFragmentExList.class)
						.add("CCCC", ExOrignFragmentEx.class)
						.add("DDDD", RentalsStyleFragment.class)
						.add("EEEE", RefreshFragment.class)
						.add("FFFF", StoreHouseUsingString.class)
						.add("GGGG", StoreHouseUsingPointList.class)
						.add("HHHH", FlyFragment.class)
						.add("IIII", MaterialFragment.class)
						.add("JJJJ", RedPointFragment.class)
						.add("HHHH", FlyFragment.class)
						.add("HHHH", FlyFragment.class)
						.add("HHHH", FlyFragment.class).create());
		ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
		viewPager.setAdapter(adapter);

		SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab);
		viewPagerTab.setDistributeEvenly(true);
		viewPagerTab.setViewPager(viewPager);
	}
}
